#include"comm.hpp"
int main()
{
    key_t k=getKey();
    printf("key:0x%x\n",k);
    int shmid=creatShm(k);
    printf("shmid:%d\n",shmid);
    sleep(5);
    char* start=(char*)attachShm(shmid);
    printf("attach sucess,address start:%p\n",start);
    //使用
    while(true)
    {
         sleep(1);
        printf("client say:%s\n",start);
       
    }
    //去关联
    detachShm(start);
    sleep(10);
    //删除共享内存
    delShm(shmid);
    return 0;
}